<?php

class Admin_Form_Zipadd extends Zend_Form {

    public function init() {
        $this->setMethod("post");

        #zip
        $zip = new Zend_Form_Element_Text('zip');
        $zip->setLabel("Enter Zipcode:")
                ->setRequired(true);

        #city
        $cityDb = new Admin_Model_City();
        $cityArray = $cityDb->fetchAll();
        $city = new Zend_Form_Element_Select('city');
        $city->setLabel('Select City:')
                ->setRequired(true);
        foreach ($cityArray as $value) {
            $city->addMultiOption($value->id, $value->name);
        }

        #submit
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel("Add New Zip")
                ->setAttribs(array('class' => 'btn btn-success'));

        #
        $this->addElements(array($zip, $city, $submit));
    }

}

